package com.cx.mall.api.goods;

import com.cx.mall.common.model.goods.Stock;
import com.cx.mall.common.utils.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "skuInfo" ,name = "mall-goods-service")
public interface SkuInfoFeign {
    @PutMapping("/goods/skuInfo/decreaseStock")
    public ResponseVO decreaseStock(@RequestBody List<Stock> stock);

    @GetMapping("/goods/skuInfo/queryByUserIdAndSkuId")
    public ResponseVO queryByUserIdAndSkuId(@RequestParam("userId") String userId, @RequestParam("skuId") String skuId);

    @GetMapping( "/goods/skuInfo/listAll")
    public ResponseVO listAll();

}
